import { get, post, put, del, upload } from '@/utils/request'

const VERSION = '/v1'

export default {
    // 融媒体
    channelList: params => get(VERSION, '/news/channel/list', params),
    addChannel: params => post(VERSION, '/news/channel', params),
    editChannel: params => put(VERSION, '/news/channel', params),
    deleteChannel: params => del(VERSION, '/news/channel', params),
    rongMediaList: params => get(VERSION, '/news/rong/page', params),
    rongMediaDetail: params => get(VERSION, '/news/rong/detail', params),
    // 模板
    templateList: params => get(VERSION, '/news/template/page', params),
    deleteTemplate: params => del(VERSION, '/news/template', params),
    // 目录
    folderList: params => get(VERSION, '/news/folder/list', params),
    addFolder: params => post(VERSION, '/news/folder', params),
    editFolder: params => put(VERSION, '/news/folder', params),
    deleteFolder: params => del(VERSION, '/news/folder', params),
    // 组件
    componentList : params => get(VERSION, '/news/component/page', params),
    // 新闻首页
    newsHomeList: params => get(VERSION, '/news/homepage/page', params),
    newsHomeAudit: params => put(VERSION, '/news/homepage/audit', params),
    deleteNewsHome: params => del(VERSION, '/news/homepage', params),
    // 新闻页
    newsPageList: params => get(VERSION, '/news/page', params),

    // 选取终端新闻屏幕查询
    screenList:params => get(VERSION, '/terminal/common/list', params),
    // 选取终端(定制)
    terminalList:params => get(VERSION, '/news/homepage/terminal/list', params),
    // 保存终端
    saveTerminal: params => post(VERSION, '/news/homepage/schedule/save', params),
    // 查看终端
    lookTerminal:params => get(VERSION, '/news/homepage/schedule/list', params),

    newsPageAudit: params => put(VERSION, '/news/audit', params),
    deleteNewsPage: params => del(VERSION, '/news', params),
    // 检测密码
    checkHomePassword: params => get(VERSION, '/news/homepage/check', params),
    checkPagePassword: params => get(VERSION, '/news/check', params),
    //媒体中心
    newsMediaPage: params => get(VERSION, '/news/media/page', params),
    // 媒体中心
    upload: (params, progressCb, cancelToken) => upload(VERSION, '/news/media/uploading', params, progressCb, cancelToken),
    modifyFolder: params => put(VERSION, '/news/media/modifyFolderMedia', params),
    getInfo: params => get(VERSION, '/news/media/info', params),
    // 选择背景图片
    loadBackgroudImg: params => get(VERSION, '/news/media/backgroundImage', params),
    deleteNewsMedia: params => del(VERSION, '/news/media', params),
    modify: params => put(VERSION, '/news/media', params),
    getWebImg: params => get(VERSION, '/news/media/webImage', params),
}
